/*
 * 版权所有 (C) 2001-2014 深圳市艾派应用系统有限公司。保留所有权利。
 * 版本：
 * 修改记录：
 *		1、2014-11-21，tfl创建。 
 */
package com.chinamobile.ln.ictenterprises.common;

import android.app.Application;

import com.chinamobile.ln.ictenterprises.db.DataBaseImpl;
import com.chinamobile.ln.ictenterprises.db.IDataBase;
import com.chinamobile.ln.ictenterprises.widget.SlidingMenu;

public class MainApplication extends Application
{
    private static MainApplication sInstance = null;
    /** 菜单 **/
    private SlidingMenu menu;
    /** 当前菜单 **/
    private int currentMenu;
    @Override
    public void onCreate()
    {
        super.onCreate();
        CrashHandler crashHandler = CrashHandler.getInstance();
        // 注册crashHandler
         crashHandler.init(getApplicationContext());
    }

    public int getCurrentMenu()
    {
        return currentMenu;
    }
    public void setCurrentMenu(int currentMenu)
    {
        this.currentMenu = currentMenu;
    }

    public SlidingMenu getMenu()
    {
        return menu;
    }

    public void setMenu(SlidingMenu menu)
    {
        this.menu = menu;
    }

    public MainApplication()
    {
        sInstance = this;
    }

    public static synchronized MainApplication getInstance()
    {
        if (sInstance == null)
        {
            sInstance = new MainApplication();
        }
        return sInstance;
    }

    public IDataBase getIDatabase()
    {
        return DataBaseImpl.getInstance(this);
    }
}
